/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package action.organization;

import com.opensymphony.xwork2.ActionSupport;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import myUtils.page.Page;
import myUtils.page.Result;
import myUtils.Constants;
import org.apache.struts2.interceptor.ServletRequestAware;
import po.User;
import service.OrgService;

/**
 *
 * @author luyang
 */
public class CheckedMemberListAction extends ActionSupport implements ServletRequestAware
{
    private OrgService orgService;
    private HttpServletRequest request;
    private List<User> member;
    private Page myPage;
    private String orgid;

     @Override
    public String execute()
     {
         int page=request.getParameter("page")==null?1:Integer.parseInt((String) request.getParameter("page"));
         int id;
         String msg;
         if(request.getParameter("id")==null)
         {
             msg="no id!!!";
             request.setAttribute("msg", msg);
             return ERROR;
         }

         id=Integer.parseInt(request.getParameter("id"));
         Result temp= orgService.getCheckedMembers(id, page);
         member=(List<User>) temp.getContent();
         myPage=temp.getPage();
         this.orgid=String.valueOf(id);
         request.setAttribute("check", String.valueOf(Constants.ORG_MEMBER));
         return SUCCESS;
     }

     public void setOrgid(String orgid)
     {
         this.orgid=orgid;
     }

     public String getOrgid()
     {
         return this.orgid;
     }

    public void setOrgService(OrgService orgService)
    {
        this.orgService=orgService;
    }

    public OrgService getOrgService()
    {
        return this.orgService;
    }

    public void setMyPage(Page myPage)
    {
        this.myPage=myPage;
    }

    public Page getMyPage()
    {
        return this.myPage;
    }

    public void setMember(List<User> member)
    {
        this.member=member;
    }

    public List<User> getMember()
    {
        return this.member;
    }

    public void setServletRequest(HttpServletRequest request)
    {
        this.request=request;
    }
}
